<template>
  <div class="container-page-home">
    <!-- 轮播图 -->
    <itemSwiper :list="banner" />
    <!-- 主体内容 -->
    <itemProduct :list="list" />
    <!-- 导航栏 -->
    <itemTabbar now-page="0" />
  </div>
</template>

<script>
// api
import { shopHome, shopBanner } from '@/api/miva'
// item
import itemTabbar from '@/components/miva-item/item-tabbar'
import itemSwiper from '@/components/banner'
import itemProduct from '@/components/item/item-product-list'
export default {
  components: {
    itemSwiper,
    itemProduct,
    itemTabbar
  },
  data() {
    return {
      list: [],
      banner: []
    }
  },
  async mounted() {
    // 获取首页列表
    const res_list = await shopHome()
    this.list = res_list.data
    // 获取banner
    const res_banner = await shopBanner()
    this.banner = res_banner.data
  },
  methods: {
    routerLink(name) {
      this.$router.push({ name })
    }
  }
}
</script>

<style lang="less" >
.container-page-home {
  width: 100%;
  padding: 5px;
}
</style>
